package com.my.admin.service.impl;

import com.my.admin.entity.Menu;
import com.my.admin.mapper.MenuMapper;
import com.my.admin.service.MenuService;
import com.my.admin.util.ServiceImplCache;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author my
 */
@Service
public class MenuServiceImpl extends ServiceImplCache<MenuMapper, Menu> implements MenuService {

    @Override
    @Cacheable(value = "getMenuByUserId")
    public List<Menu> getMenuByUserId(Long userId) {
        return baseMapper.getMenuByUserId(userId);
    }

    @Override
    @Cacheable(value = "getList")
    public List<Menu> getList() {
        return baseMapper.getList();
    }

}
